﻿using EntGuayasSLA.BL;
using Ext.Net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace EGuayas.Web.Auditoria.Promo.PMA
{
    public partial class pgPMA : pgBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {try
        {
            if (!X.IsAjaxRequest)
            {

                var id = Request["cpm_id"];
                Session[SessionPage.PageGestionPromoAudPma+ Constantes.APMA] = id;
                var ExpedienteId = Request["exp_id"];
                Session[SessionPage.PageGestionPromoAudPma + Constantes.Expediente] = ExpedienteId;
                Session[SessionPage.PageGestionPromoAudPma + "codFase_" + Constantes.APMA] = Constantes.APMA;//revisar si PageGestionAdminAudMon o PageGestionPromoAudMon
                Session[SessionPage.PageGestionPromoAudPma + "FASE_ID_" + Constantes.APMA] = id;
                Session[SessionPage.PageGestionPromoAudPma + "_estadoFase" + Constantes.APMA] = Request["estado"];
            }
        }
        catch (Exception ex)
        {
            RegistrarLog(ex);
        }
        }
        #region Documentos Promotor

        /// <summary>
        /// Inicializar constante de Borrardor
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OnLoadDocPmaAdded(object sender, ComponentAddedEventArgs e)
        {
            try
            {
            Ext.Net.Panel panel = (Ext.Net.Panel)e.Control;
            SetCustomConfigWucAllAud(panel, Constantes.APMA, Valores.Modulo_Archivo_Aud_Pma, SessionPage.PageGestionPromoAudPma, Request["cpm_id"], Request["exp_id"], Request["exa_id"]);
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
        }
        protected void OnInformeAdded(object sender, ComponentAddedEventArgs e)
        {
            try
            {
                Ext.Net.Panel panel = (Ext.Net.Panel)e.Control;
                SetCustomConfigWucAllAud(panel, Constantes.APMA, Valores.Modulo_Archivo_Informes_Aud_Pma, SessionPage.PageGestionPromoAudPma, Request["cpm_id"], Request["exp_id"], Request["exa_id"]);
            }
            catch (Exception ex)
            {
                RegistrarLog(ex);
            }
        }
        #endregion
    }
}